Optimal. Leaf size=171 \[ \frac {2 \left (3 a^2 A+2 a b B+A b^2\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}+\frac {2 \left (5 a^2 B+10 a A b+3 b^2 B\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 b (2 a B+A b) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {2 b^2 B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.34, antiderivative size = 171, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.212, Rules used = {2960, 4024, 4047, 3771, 2639, 4045, 2641} \[ \frac {2 \left (3 a^2 A+2 a b B+A b^2\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}+\frac {2 \left (5 a^2 B+10 a A b+3 b^2 B\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 b (2 a B+A b) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {2 b^2 B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2639
Rule 2641
Rule 2960
Rule 3771
Rule 4024
Rule 4045
Rule 4047
Rubi steps
\begin {align*} \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx &=\int \frac {(b+a \sec (c+d x))^2 (B+A \sec (c+d x))}{\sec ^{\frac {5}{2}}(c+d x)} \, dx\\ &=\frac {2 b^2 B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}-\frac {2}{5} \int \frac {-\frac {5}{2} b (A b+2 a B)+\left (-5 a A b+\left (-\frac {5 a^2}{2}-\frac {3 b^2}{2}\right ) B\right ) \sec (c+d x)-\frac {5}{2} a^2 A \sec ^2(c+d x)}{\sec ^{\frac {3}{2}}(c+d x)} \, dx\\ &=\frac {2 b^2 B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}-\frac {2}{5} \int \frac {-\frac {5}{2} b (A b+2 a B)-\frac {5}{2} a^2 A \sec ^2(c+d x)}{\sec ^{\frac {3}{2}}(c+d x)} \, dx-\frac {1}{5} \left (-10 a A b-5 a^2 B-3 b^2 B\right ) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx\\ &=\frac {2 b^2 B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 b (A b+2 a B) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}-\frac {1}{3} \left (-3 a^2 A-A b^2-2 a b B\right ) \int \sqrt {\sec (c+d x)} \, dx-\frac {1}{5} \left (\left (-10 a A b-5 a^2 B-3 b^2 B\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx\\ &=\frac {2 \left (10 a A b+5 a^2 B+3 b^2 B\right ) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 b^2 B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 b (A b+2 a B) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}-\frac {1}{3} \left (\left (-3 a^2 A-A b^2-2 a b B\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 \left (10 a A b+5 a^2 B+3 b^2 B\right ) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 \left (3 a^2 A+A b^2+2 a b B\right ) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 b^2 B \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 b (A b+2 a B) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.91, size = 128, normalized size = 0.75 \[ \frac {\sqrt {\sec (c+d x)} \left (10 \left (3 a^2 A+2 a b B+A b^2\right ) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )+6 \left (5 a^2 B+10 a A b+3 b^2 B\right ) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+b \sin (2 (c+d x)) (10 a B+5 A b+3 b B \cos (c+d x))\right )}{15 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 1.81, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B b^{2} \cos \left (d x + c\right )^{3} + A a^{2} + {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{2} + {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )\right )} \sqrt {\sec \left (d x + c\right )}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \cos \left (d x + c\right ) + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \sqrt {\sec \left (d x + c\right )}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 1.40, size = 487, normalized size = 2.85 \[ -\frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-24 B \,b^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (20 A \,b^{2}+40 B a b +24 b^{2} B \right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-10 A \,b^{2}-20 B a b -6 b^{2} B \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+15 a^{2} A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+5 A \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-30 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a b +10 B a b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-15 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a^{2}-9 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b^{2}\right )}{15 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \cos \left (d x + c\right ) + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \sqrt {\sec \left (d x + c\right )}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \left (A+B\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {1}{\cos \left (c+d\,x\right )}}\,{\left (a+b\,\cos \left (c+d\,x\right )\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \cos {\left (c + d x \right )}\right ) \left (a + b \cos {\left (c + d x \right )}\right )^{2} \sqrt {\sec {\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________